package com.jiawei;

import com.jiawei.Interaction.WebSocketServer;
import com.jiawei.exceptions.CustomException;
import com.jiawei.pojo.ParamConfig;
import com.jiawei.utils.SerialPortUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.List;

/**
 * @author : willian fu
 * @version : 1.0
 */
@SpringBootApplication
public class MainProgram {
    public static void main(String[] args) throws CustomException {
        SpringApplication.run(MainProgram.class, args);
        // 实例化串口操作类对象
        /*SerialPortUtils serialPort = new SerialPortUtils();
        List portsName = serialPort.getAvailableSerialPortsName();
        portsName.forEach(num-> System.out.println(num));
        // 创建串口必要参数接收类并赋值，赋值串口号，波特率，校验位，数据位，停止位
        ParamConfig paramConfig = new ParamConfig("COM2", 9600, 0, 8, 1);
        // 初始化设置,打开串口，开始监听读取串口数据
        serialPort.init(paramConfig);
        // 调用串口操作类的sendComm方法发送数据到串口
        serialPort.sendComm("FEF10A000000000000000AFF");
        // 关闭串口
        serialPort.closeSerialPort();*/
    }
}
